#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#if 0
int main()
{
	int a = 10;
	printf("%d\n", sizeof(a));
	printf("%d\n", sizeof a);
	printf("%d\n", sizeof(int));
	return 0;
}

int main()
{
	char arr1[3] = { 'a', 'b', 'c' };
	char arr2[] = "abc";
	printf("%d\n", strlen(arr1));
	printf("%d\n", strlen(arr2));
	printf("%d\n", sizeof(arr1));
	printf("%d\n", sizeof(arr1));
	return 0;
}

	int a[] = { 1,2,3,4 };				
	printf("%d\n", sizeof(a));			//1
	printf("%d\n", sizeof(a + 0));		//2
	printf("%d\n", sizeof(*a));			//3
	printf("%d\n", sizeof(a + 1));		//4
	printf("%d\n", sizeof(a[1]));		//5
	printf("%d\n", sizeof(&a));			//6
	printf("%d\n", sizeof(*&a));		//7
	printf("%d\n", sizeof(&a + 1));		//8
	printf("%d\n", sizeof(&a[0]));		//9
	printf("%d\n", sizeof(&a[0] + 1));	//10

	char arr[] = { 'a','b','c','d','e','f' };
	printf("%d\n", sizeof(arr));		//1
	printf("%d\n", sizeof(arr + 0));	//2
	printf("%d\n", sizeof(*arr));		//3
	printf("%d\n", sizeof(arr[1]));		//4
	printf("%d\n", sizeof(&arr));		//5
	printf("%d\n", sizeof(&arr + 1));	//6
	printf("%d\n", sizeof(&arr[0] + 1));//7

	char arr[] = { 'a','b','c','d','e','f' };
	printf("%d\n", strlen(arr));		//1
	printf("%d\n", strlen(arr + 0));	//2
	printf("%d\n", strlen(*arr));		//3
	printf("%d\n", strlen(arr[1]));		//4
	printf("%d\n", strlen(&arr));		//5
	printf("%d\n", strlen(&arr + 1));	//6
	printf("%d\n", strlen(&arr[0] + 1));//7

	char arr[] = "abcdef";				
	printf("%d\n", sizeof(arr));		//1
	printf("%d\n", sizeof(arr + 0));	//2
	printf("%d\n", sizeof(*arr));		//3
	printf("%d\n", sizeof(arr[1]));		//4
	printf("%d\n", sizeof(&arr));		//5
	printf("%d\n", sizeof(&arr + 1));	//6
	printf("%d\n", sizeof(&arr[0] + 1));//7

	char arr[] = "abcdef";
	printf("%d\n", strlen(arr));		//1
	printf("%d\n", strlen(arr + 0));	//2
	printf("%d\n", strlen(*arr));		//3
	printf("%d\n", strlen(arr[1]));		//4
	printf("%d\n", strlen(&arr));		//5
	printf("%d\n", strlen(&arr + 1));	//6
	printf("%d\n", strlen(&arr[0] + 1));//7

	char* p = "abcdef";					
	printf("%d\n", sizeof(p));			//1
	printf("%d\n", sizeof(p + 1));		//2
	printf("%d\n", sizeof(*p));			//3
	printf("%d\n", sizeof(p[0]));		//4
	printf("%d\n", sizeof(&p));			//5
	printf("%d\n", sizeof(&p + 1));		//6
	printf("%d\n", sizeof(&p[0] + 1));	//7

	char* p = "abcdef";					
	printf("%d\n", strlen(p));			//1
	printf("%d\n", strlen(p + 1));		//2
	printf("%d\n", strlen(*p));			//3
	printf("%d\n", strlen(p[0]));		//4
	printf("%d\n", strlen(&p));			//5
	printf("%d\n", strlen(&p + 1));		//6
	printf("%d\n", strlen(&p[0] + 1));	//7

int main(void)
{
	int a[3][4] = { 0 };
	printf("%d\n", sizeof(a));				//1
	printf("%d\n", sizeof(a[0][0]));		//2
	printf("%d\n", sizeof(a[0]));			//3
	printf("%d\n", sizeof(a[0] + 1));		//4
	printf("%d\n", sizeof(*(a[0] + 1)));	//5
	printf("%d\n", sizeof(a + 1));			//6
	printf("%d\n", sizeof(*(a + 1)));		//7
	printf("%d\n", sizeof(&a[0] + 1));		//8
	printf("%d\n", sizeof(*(&a[0] + 1)));	//9
	printf("%d\n", sizeof(*a));				//10
	printf("%d\n", sizeof(a[3]));			//11
	return 0;
}

int main()
{
	int a[5] = { 1, 2, 3, 4, 5 };
	int* ptr = (int*)(&a + 1);
	printf("%d,%d", *(a + 1), *(ptr - 1));
	return 0;
}

struct Test
{
	int Num;
	char* pcName;
	short sDate;
	char cha[2];
	short sBa[4];
}*p = (struct Test*)0x100000;

int main()
{
	printf("%p\n", p + 0x1);
	printf("%p\n", (unsigned long)p + 0x1);
	printf("%p\n", (unsigned int*)p + 0x1);
	return 0;
}

int main()
{
	int a[3][2] = { (0, 1), (2, 3), (4, 5) };
	int* p;
	p = a[0];
	printf("%d", p[0]);
	return 0;
}

int main()
{
	int a[5][5];
	int(*p)[4];
	p = a;
	printf("%p,%d\n", &p[4][2] - &a[4][2], &p[4][2] - &a[4][2]);
	return 0;
}

int main()
{
	int aa[2][5] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
	int* ptr1 = (int*)(&aa + 1);
	int* ptr2 = (int*)(*(aa + 1));
	printf("%d,%d", *(ptr1 - 1), *(ptr2 - 1));
	return 0;
}

int main()
{
	char* a[] = { "work","at","alibaba" };
	char** pa = a;
	pa++;
	printf("%s\n", *pa);
	return 0;
}
#endif

int main()
{
	char* c[] = { "ENTER","NEW","POINT","FIRST" };
	char** cp[] = { c + 3,c + 2,c + 1,c };
	char*** cpp = cp;
	printf("%s\n", **++cpp);
	printf("%s\n", *-- * ++cpp + 3);
	printf("%s\n", *cpp[-2] + 3);
	printf("%s\n", cpp[-1][-1] + 1);
	return 0;
}














